HttpAuthentication.createOAuthAuthentication

Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server. This function is only applicable with the resource owner password credentials grant OAuth method. The scope parameter overrides the scope configured on the server administrator application.

Example:

 var params = {show_dialog : true};
 var auth = HttpAuthentication.createOAuthAuthentication("oauthconfigname", "private-read", null, null, params);
 var response = services.rest.get(.., .., .., auth);
 
Further documentation.

returns OAuthAuthentication

Parameters

java.lang.String  name,  java.lang.String  scope,  java.lang.String  username,  java.lang.String  password,  java.util.Map  additionalParameters,